<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>公共弹窗-行业列表</title>
    <link rel="stylesheet" type="text/css" href="../../css/base.css" />
    <link rel="stylesheet" href="../../css/vant.css">
    <style>
        html,
        body,
        .global-layout {
            background: none;
        }

        .border-bottom::before {
            border-color: #eaeaea;
        }

        .van-action-sheet__cancel::before {
            content: none;
        }

        .van-action-sheet__cancel {
            border-top: 1px solid #ebedf0;
            opacity: 0.5;
        }

        .van-action-sheet__cancel {
            background: rgba(250, 250, 250, 1);
            font-weight: 400;
            color: rgba(51, 51, 51, 1);
        }
    </style>
</head>

<body>
    <div id="app" class="global-layout">
        <van-popup v-model="industryShow" position="bottom" :close-on-click-overlay="false" @click-overlay="closePopup">
            <van-area :area-list="aera_arr" confirm-button-text="完成" @cancel="closePopup" @confirm="handelCityConfirm" />
            <!-- @cancel="closePopup" @confirm="handelCityConfirm" -->
        </van-popup>
    </div>
</body>

</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/vant.min.js"></script>
<script type="text/javascript" src="../../res/area.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: '#app',
        data: {
            industryShow: true,
            aera_arr: []
        },
        methods: {
            closePopup: function() {
                vm.industryShow = false;
                api.closeFrame({
                    name: 'setindustry_popup'
                });
            },
            handelCityConfirm: function(value) {
              // alert(JSON.stringify(value))
              // return
               var regionId = value[2].code;
                var addressValue = '';
                if (value[0].name != value[1].name) {
                    addressValue = value[0].name + '-' + value[1].name + '-' + value[2].name;
                } else {
                    addressValue = value[0].name + '-' + value[2].name;
                }
                send_event('setaddress_popup', {
                    addressValue: addressValue,
                    regionId : regionId
                })
                vm.industryShow = false;
                api.closeFrame({
                    name: 'setindustry_popup'
                });
            },
            closePopup: function() {
                vm.industryShow = false;
                api.closeFrame({
                    name: 'setindustry_popup'
                });
            }
        }
    });
    apiready = function() {
        vm.aera_arr = AreaList;
        api.parseTapmode();
    }
</script>
